import * as CONSTANT from './constatns'
import { fromJS } from 'immutable'

const defaultState = fromJS({
    isfocused : false,
    list :[],
})


//eslint-disable-next-line
export default (state = defaultState ,action) => {
    if(action.type === CONSTANT.SEARCHONFOCUS){
        return state.set('isfocused',true)
       
    }
    if(action.type === CONSTANT.SEARCHONBLUR){
        return state.set('isfocused',false)

    }
    if(action.type === CONSTANT.GETSEARCHLIST){
        return state.set('list',action.list)
    }
    return state
}